import request from '@/utils/request'


// 查询用户列表
export function listTree() {
  return request({
    url: '/park/building/getTree',
    method: 'get',
  })
}

export function getBuildingTypeAll() {
  return request({
    url: '/park/building/getBuildingTypeAll',
    method: 'get',
  })
}

//查询所有楼栋
export function getBuildingAll(query) {
  return request({
    url: '/park/building/getBuildingAll',
    method: 'get',
    params: query
  })
}

//修改根据id查楼栋回显
export function getBuildingById(id) {
  return request({
    url: '/park/building/getBuildingById/' + id,
    method: 'get',
  })
}

//修改根据id查楼栋回显
export function getBuildingByName(name) {
  return request({
    url: '/park/building/getBuildingByName?name=' + name,
    method: 'get',
  })
}

//删除楼栋
export function deleteBuliding(id) {
  return request({
    url: '/park/building/deleteBuliding/' + id,
    method: 'delete',
  })
}

//添加楼栋
export function addBuliding(form) {
  return request({
    url: '/park/building/addBuliding',
    method: 'post',
    data: form
  })
}

//修改楼栋
export function updateBuliding(form) {
  return request({
    url: '/park/building/updateBuliding',
    method: 'put',
    data: form
  })
}
